package Demo;

import java.util.Scanner;

public class Demo05 {
    public static void main(String[] args) {
        // 键盘输入年代和月份和日期，判断这一天是这一年的第几天

        Scanner s = new Scanner(System.in);

        System.out.println("请输入年代");
        int year = s.nextInt();

        System.out.println("请输入月代");
        int mouth = s.nextInt();

        System.out.println("请输入天数");
        int day = s.nextInt();

        int sumDays = 0;

        switch(mouth){
            case 12:
                sumDays += 30;
            case 11:
                sumDays += 31;
            case 10:
                sumDays += 30;
            case 9:
                sumDays += 31;
            case 8:
                sumDays += 31;
            case 7:
                sumDays += 30;
            case 6:
                sumDays += 31;
            case 5:
                sumDays += 3;
            case 4:
                sumDays += 31;
            case 3:

                if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0){
                    sumDays += 29;
                }else{
                    sumDays += 28;
                }
            case 2:

                sumDays += 31;
            case 1:
                sumDays += day;
                break;
        }


    }
}
